/*
 * Copyright (c) 2020 Tunaiyi
 * Tny Framework is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *          http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
 * NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */
package com.tny.game.namespace.etcd;

import com.tny.game.codec.*;
import com.tny.game.namespace.*;
import com.tny.game.namespace.sharding.*;

/**
 * 多节点 HashMap 工厂
 * <p>
 *
 * @author kgtny
 * @date 2022/7/21 10:30
 **/
public class EtcdNodeHashingMultimapFactory implements NodeHashingFactory {

    private static final EtcdNodeHashingMultimapFactory FACTORY = new EtcdNodeHashingMultimapFactory();

    public static NodeHashingFactory getDefault() {
        return FACTORY;
    }

    @Override
    public <N extends ShardingNode> NodeHashing<N> create(String rootPath, HashingOptions<N> option, NamespaceExplorer explorer,
            ObjectCodecAdapter adapter) {
        return new EtcdNodeHashingMultimap<>(rootPath, option, explorer, adapter);
    }

}
